package org.self.autoconfig;

import org.self.properties.JwtTokenProperties;
import org.self.service.ITokenService;
import org.self.service.impl.TokenService;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 作者: liYU
 * 项目名称: WX_Self_Iot_parent
 * 标题: TokenServiceAutoConfiguration
 * 该类描述: TODO
 * 创建日期: 2025/3/31 21:50
 */

@Configuration
@EnableConfigurationProperties(JwtTokenProperties.class)
public class TokenServiceAutoConfiguration {

    @Bean
    public ITokenService tokenService(JwtTokenProperties jtp){
        TokenService tokenService = new TokenService();
        tokenService.setSign(jtp.getSign());
        tokenService.setExpire(jtp.getExpire());
        return tokenService;
    }

}
